Conversation
rickyrombo
commented
Jan 23, 2026
- Removes old upload saga and references
- Reverts tanstack query version to prevent error in production static builds, opting to copy/paste the mutateOptions method instead
- Fix sparse arrays in progress for stems causing crash
- Fix progress going backwards when there's stems
- Fix error icon color to not be black
|
dylanjeffers
left a comment
There was a problem hiding this comment.
looks so dang good, nice work
| total: 0, | ||
| transcode: 0 | ||
| } | ||
| const stems = newState.uploadProgress[trackIndex].stems |
There was a problem hiding this comment.
so one stem update creates the progress for the others? wouldn't it be safer to just initialize this array in its entirety up front?
There was a problem hiding this comment.
The way this works going forward is that progress starts reporting immediately after the "Select" page while the files upload in the background. But the users can select more stems on the next page. So before the user clicks "Confirm" there's already a progress report on their selected tracks but not for the art or stems - we need to then extend the initialized progress to include that.
To prevent this from showing progress going backwards, in the selector I check for the existence of the formState and use the formState's count of tracks/stems as the denominator. This prevents any race condition, as the formState gets set first before the stem upload progresses are fired off.
Rather than ensuring dense arrays, I could have also made the selector more defensive, but I think this is better.